|
rtc23 2.2.1
|
API for configuring and manipulating RTC 23 Click driver. More...
Topics | |
| RTC 23 Registers List | |
| List of registers of RTC 23 Click driver. | |
| RTC 23 Registers Settings | |
| Settings for registers of RTC 23 Click driver. | |
| RTC 23 MikroBUS Map | |
| MikroBUS pin mapping of RTC 23 Click driver. | |
Functions | |
| void | rtc23_cfg_setup (rtc23_cfg_t *cfg) |
| RTC 23 configuration object setup function. | |
| err_t | rtc23_init (rtc23_t *ctx, rtc23_cfg_t *cfg) |
| RTC 23 initialization function. | |
| err_t | rtc23_write_regs (rtc23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| RTC 23 write regs function. | |
| err_t | rtc23_read_regs (rtc23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| RTC 23 read regs function. | |
| err_t | rtc23_write_reg (rtc23_t *ctx, uint8_t reg, uint8_t data_in) |
| RTC 23 write reg function. | |
| err_t | rtc23_read_reg (rtc23_t *ctx, uint8_t reg, uint8_t *data_out) |
| RTC 23 read reg function. | |
| void | rtc23_set_wdi_pin (rtc23_t *ctx, uint8_t state) |
| RTC 23 set WDI pin function. | |
| uint8_t | rtc23_get_psw_pin (rtc23_t *ctx) |
| RTC 23 get PSW pin function. | |
| uint8_t | rtc23_get_int_pin (rtc23_t *ctx) |
| RTC 23 get INT pin function. | |
| err_t | rtc23_check_communication (rtc23_t *ctx) |
| RTC 23 check communication function. | |
| err_t | rtc23_set_time (rtc23_t *ctx, rtc23_time_t *time) |
| RTC 23 set time function. | |
| err_t | rtc23_read_time (rtc23_t *ctx, rtc23_time_t *time) |
| RTC 23 read time function. | |
| err_t | rtc23_set_date (rtc23_t *ctx, rtc23_date_t *date) |
| RTC 23 set date function. | |
| err_t | rtc23_read_date (rtc23_t *ctx, rtc23_date_t *date) |
| RTC 23 read date function. | |
API for configuring and manipulating RTC 23 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void rtc23_cfg_setup | ( | rtc23_cfg_t * | cfg | ) |
RTC 23 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See rtc23_cfg_t object definition for detailed explanation. |
| err_t rtc23_check_communication | ( | rtc23_t * | ctx | ) |
RTC 23 check communication function.
This function checks the communication by reading and verifying the device ID.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | uint8_t rtc23_get_int_pin | ( | rtc23_t * | ctx | ) |
RTC 23 get INT pin function.
This function returns the interrupt (INT) pin logic state.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| uint8_t rtc23_get_psw_pin | ( | rtc23_t * | ctx | ) |
RTC 23 get PSW pin function.
This function returns the power switch (PSW) pin logic state.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| err_t rtc23_init | ( | rtc23_t * | ctx, |
| rtc23_cfg_t * | cfg ) |
RTC 23 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See rtc23_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_read_date | ( | rtc23_t * | ctx, |
| rtc23_date_t * | date ) |
RTC 23 read date function.
This function reads the current date values - day of week, day, month and year.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [out] | date | : Date object structure. See rtc23_date_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_read_reg | ( | rtc23_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
RTC 23 read reg function.
This function reads a data byte from the selected register by using SPI serial interface.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Output read data. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_read_regs | ( | rtc23_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
RTC 23 read regs function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_read_time | ( | rtc23_t * | ctx, |
| rtc23_time_t * | time ) |
RTC 23 read time function.
This function reads the current time values - second 100th, second, minute and hour.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [out] | time | : Time object structure. See rtc23_time_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_set_date | ( | rtc23_t * | ctx, |
| rtc23_date_t * | date ) |
RTC 23 set date function.
This function sets the starting date values - day of week, day, month and year.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | date | : Date object structure that carries day of week, day, month and year values in Decimal format. See rtc23_date_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_set_time | ( | rtc23_t * | ctx, |
| rtc23_time_t * | time ) |
RTC 23 set time function.
This function sets the starting time values - second 100th, second, minute and hour.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | time | : Time object structure that carries second 100th, second, minute and hour values in Decimal format. See rtc23_time_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void rtc23_set_wdi_pin | ( | rtc23_t * | ctx, |
| uint8_t | state ) |
RTC 23 set WDI pin function.
This function sets the watchdog reset (WDI) pin logic state.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| err_t rtc23_write_reg | ( | rtc23_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
RTC 23 write reg function.
This function writes a data byte to the selected register by using SPI serial interface.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t rtc23_write_regs | ( | rtc23_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
RTC 23 write regs function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
| [in] | ctx | : Click context object. See rtc23_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [in] | data_in | : Data to be written. |
| [in] | len | : Number of bytes to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.